package common.item
{
	import com.common.utils.Reflection;
	
	import common.item.IconItem;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	
	/**
	 *道具物品item 
	 * @author lake
	 * 
	 */	
	public class LPropItem extends IconItem
	{
		public function LPropItem()
		{
			super();
		}
		override public function set data(value:*):void
		{
			_data = value;
			var bgSkin :MovieClip = Reflection.createInstance("com.liangzhong.ui.res.PropBg");
			var iconSkin :DisplayObject;
			if(value is String)
			{
				iconSkin = Reflection.createInstance(value);
			}
			else if(value is BitmapData)
			{
				iconSkin = new Bitmap(value);
			}
			else if(value is DisplayObject)
			{
				iconSkin = value as DisplayObject;
			}
			if(bgSkin && bgSkin.container && iconSkin)
			{
				this.addChild(bgSkin);
				bgSkin.container.addChild(iconSkin);
			}
		}
	}
}